package com.ywk.base.common.office.excel;

import java.io.Serializable;

/**
 * 在ExportExcel工具类里，将获取到的@ExcelField注解转成了Anno.class实体类
 * 修改成这个逻辑，是为了扩展导出工具类，不用@ExcelField注解也能做到导出，可以避免写很多实体类
 * @author binzec
 */
public class Anno implements Serializable {

	/**
	 * 导出到excel的类型<br>
	 * 	ANNO_STRING-强制为字符串类型<br>
	 * 	ANNO_NUMBER-强制为数字类型<br>
	 * 	ANNO_AUTO-默认情况，按查询结果类型自动判断<br>
	 */
	public static final int ANNO_AUTO = 0;
	public static final int ANNO_STRING = 1;
	public static final int ANNO_NUMBER = 2;
	
/*===================================================================================*/
	
	private static final long serialVersionUID = 2001563669185710185L;
	private String fieldName;  // 字段名
	private String title;      // 导出字段标题（需要添加批注请用“**”分隔，格式为：标题**批注）
	private int type;          // 字段类型（0：导出导入；1：仅导出；2：仅导入）（默认0）
	private int align;         // 导出字段对齐方式（1：靠左；2：居中；3：靠右）（默认2）
	private int sort;          // 导出字段字段排序（从小到大->从左往右）
	private String[] groups;   // 字段归属组（根据分组导出导入）
	private int clazz;		   // 导出后的格式（默认）
	
	public Anno(String fieldName, String title, int sort) {
		super();
		this.fieldName = fieldName;
		this.title = title;
		this.sort = sort;
		this.type = 0;
		this.align = 2;
		this.clazz = ANNO_AUTO;
	}
	public Anno(String fieldName, String title, int sort, int clazz) {
		super();
		this.fieldName = fieldName;
		this.title = title;
		this.sort = sort;
		this.type = 0;
		this.align = 2;
		this.clazz = clazz;
	}
	public Anno(String fieldName, String title, int type, int align, int sort, String[] groups, int clazz) {
		super();
		this.fieldName = fieldName;
		this.title = title;
		this.type = type;
		this.align = align;
		this.sort = sort;
		this.groups = groups;
		this.clazz = clazz;
	}
	
	public int getClazz() {
		return clazz;
	}
	public void setClazz(int clazz) {
		this.clazz = clazz;
	}
	public String getFieldName() {
		return fieldName;
	}
	public void setFieldName(String fieldName) {
		this.fieldName = fieldName;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getAlign() {
		return align;
	}
	public void setAlign(int align) {
		this.align = align;
	}
	public int getSort() {
		return sort;
	}
	public void setSort(int sort) {
		this.sort = sort;
	}
	public String[] getGroups() {
		return groups;
	}
	public void setGroups(String[] groups) {
		this.groups = groups;
	}
	
}